package JAVASE514;

import java.util.Random;
import java.util.Scanner;

public class JAVARandom {
    public static void main(String[] argc){
        Random r=new Random();
        //生成随机数
        int i= r.nextInt(101);
        while(true){
            System.out.println("请猜数字：");
            Scanner sc=new Scanner(System.in);
            int x= sc.nextInt();
            if(x==i){
                System.out.println("猜中了！");
                break;
            }else if(x<i){
                System.out.println("小了");
            }else if(x>i){
                System.out.println("大了");
            }
        }
    }
}
